/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.cx1.model.utils;

import java.util.Comparator;
import org.apache.commons.lang.StringUtils;
import org.cx1.model.FeaturedList;

/**
 *
 * @author ECH
 */
public class FeaturedListComparator implements Comparator<FeaturedList> {
    
    @Override
    public int compare(FeaturedList o1, FeaturedList o2) {        
        if (!StringUtils.isEmpty(o1.getId()) && !StringUtils.isEmpty(o2.getId())) {
            return Integer.parseInt(o1.getId()) > Integer.parseInt(o2.getId()) ? 1 : -1;            
        }
        else {
            return 0;
        }
    }
}
